size1 = int(input('输入方块1边框长度（奇数）：'))
size2 = int(input('输入方块2边框长度（奇数）：'))
total = size1+size2
if size1> size2:
    max = size1
else:
    max = size2
outStr = ''
for i in range(1,max + 1):
    for j in range(1,total + 1):
        if j <= size1 and (i == 1 or i == size1 or i == int((size1+1)/2)):
            if j == size1:
                outStr += '*   '
            else:
                outStr += '* '
        elif j >size1 and (i == 1 or i == size2 or i == int((size2+1)/2)):
            if j == total:
                outStr += '* \n'
            else:
                outStr += '* '
        elif j == 1 or j == size1 or j == int((size1+1)/2):
            if i <= size1 and j != size1:
                outStr += '* '
            elif i <= size1 and j == size1:
                outStr += '*   '
            elif i > size1 and j == size1:
                outStr += '    '
            else:
                outStr += '  '
        elif j == size1 + 1 or j == int((size2+1)/2) + size1 or j == total:
            if i <= size2 and j == total:
                outStr += '* \n'
            elif i <= size2:
                outStr += '* '
            elif j == total:
                outStr += '  \n'
            else:
                outStr+='  '
        elif j <= size1 and j == i:
            outStr += '* '
        elif j <= size1 and j + i == size1 + 1:
            outStr += '* '
        elif j>size1 and j - size1 == i:
            outStr += '* '
        elif j>size1 and j + i - size1 == size2 + 1:
            outStr += '* '
        else:
            outStr += '  '

print(outStr)